﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CP.Entities;
using CP.Utility;

namespace CP.Win.IViews.GPM
{
    public delegate int MenuAuthHandler(int groupid,IList<string> menus);
    public delegate int MenuUnAuthHandler(int groupid, IList<string> menus);
    public delegate int MenuUnAuthQueryHandler(int groupid);
    public delegate int MenuAuthQueryHandler(int groupid);
    public interface IWebpartAuthView
    {
        void BindUser_Groups(IList<User_Group> usergroup);
        event EventHandler<QueryEventArgs> QuerySubmit;
        event EventHandler<PositionEventArgs> PositionChanged;
        event MenuAuthHandler MenuAuth;
        event MenuUnAuthHandler MenuUnAuth;
        event MenuUnAuthQueryHandler MenuUnAuthQuery;
        event MenuAuthQueryHandler MenuAuthQuery;

        void BindAuthMenu(IList<Menu> menus);
        void BindUnAuthMenu(IList<Menu> menus);
    }

    public class QueryEventArgs : EventArgs
    {
        public QueryCondition QueryConditions { get; private set; }
        public QueryEventArgs(QueryCondition condition)
        {
            this.QueryConditions = condition;
        }
    }

    public class PositionEventArgs : EventArgs
    {
        public int GroupID { get; private set; }
        public PositionEventArgs(int groupid)
        {
            this.GroupID = groupid;
        }
    }
     
}
